<?php

namespace V1\Controller;

use Common\Controller\ApiController;

class UserDetailsController extends ApiController
{
    public function rest()
    {
        switch ($this->_method) {
            case 'get': // get请求处理代码
                $this->_get();
                break;
        }
    }

    /**
     * 获取个人资料
     */
    private function _get()
    {
        $uid = I('get.uid');    //需要获取资料的id
        $userid = $this->userId; //用户自己id
        $data = D('MemberProfile')->get_user_details_common($uid,'',$userid);
        if ($data) {
            $this->myApiPrint(C('STATUS')['200'], 200, $data);
        } else {
            $this->myApiPrint($data, 201);
        }
    }

}
